package com.taxi.driver.data.order;

import com.taxi.driver.data.entity.CanGrapOrdersEntity;
import com.taxi.driver.data.entity.CancelDesEntity;
import com.taxi.driver.data.entity.ComplainResultEntity;
import com.taxi.driver.data.entity.OrderCostEntity;
import com.taxi.driver.data.entity.OrderEntity;
import com.taxi.driver.data.entity.OrderHomeStatusEntity;
import com.taxi.driver.data.entity.OrderSummaryEntity;
import com.taxi.driver.data.entity.WaitFare;
import com.taxi.driver.data.entity.WxpayInfo;

import java.util.List;

import rx.Observable;

/**
 * 功能描述："订单仓库"需实现的接口
 */
public interface OrderSource {

    void cacheOrder(OrderEntity entity); //缓存订单

    Observable<OrderHomeStatusEntity> reqHomeStatus(); // 获取首页订单状态

    Observable<List<OrderSummaryEntity>> reqOrderList(int nowPage); // 获取订单列表

    Observable<OrderEntity> reqGrab(String orderUuid); // 抢单

    /**
     * 获取订单详情（优先从本地缓存中获取）
     *
     * @param orderUuid 订单编号
     * @return
     */
    Observable<OrderEntity> reqOrderDetail(String orderUuid);

    /**
     * 获取订单详情
     *
     * @param orderUuid      订单编号
     * @param onlyFromRemote 只从服务端获取
     * @return
     */
    Observable<OrderEntity> reqOrderDetail(String orderUuid, boolean onlyFromRemote);

    Observable<String> reqPickUpPas(String orderUuid, String uploadText); //出发去接乘客

    Observable<String> reqDepart(String orderUuid, String uploadText); // 到达上车地点

    Observable<String> reqGetOn(String orderUuid, double waitMile, String uploadText);// 接到乘客

    Observable<String> reqArrive(String orderUuid, double tripDistance, String destAddress,
                                 String destDetailAddress, String destCity, double destLng,
                                 double destLat, String uploadText); // 到达目的地（专车）

    Observable<String> reqUpdateFare(String orderUuid, double actualFare); // 保存订单金额

    Observable<String> receiveCash(String orderUuid, String uploadText); // 出租车收到现金

    Observable<String> reqCancelOrder(String orderUuid, String cancelMsg, String uploadText); // 取消订单

    Observable<String> reqComplainOrder(String orderUuid, String contents, String remark); // 投诉

    Observable<String> rushFare(String orderUuid); // 催款

    Observable<ComplainResultEntity> isComplain(String orderUuid); //获取投诉状态

    Observable<CancelDesEntity> cancelDescription(String orderUuid); //获取取消描述

    Observable<WxpayInfo> payByWechat(String orderUuid, String spbillCreateIp); //微信支付

    Observable<String> payByAlipay(String orderUuid); //支付宝支付

    Observable<String> payByBalance(String orderUuid); //余额支付

    Observable<OrderCostEntity> reqFareItems(String orderUuid); //获取费用明细

    Observable<OrderCostEntity> getRealtimeFare(String orderUuid); //获取实时费用明细(专车)

    Observable<OrderCostEntity> orderFare(String orderUuid); //获取费用明细(专车)

    Observable<String> confirmFare(String orderUuid, Integer highwayFare, Integer roadBridgeFare,
                                   Integer otherFare, String uploadText); //确认费用

    Observable<WaitFare> waitFare(String orderUuid); //获取超时等待费

    Observable<List<OrderSummaryEntity>> getAppointmentList();

    Observable<CanGrapOrdersEntity> canGrapOrders(String areaCode);

    Observable<List<OrderSummaryEntity>> getOrderPool(String areaCode);

    void ignoringOrder(String orderUuid);

    Observable<List<String>> ignoreList();
}
